package com.example.project.quartz.task;

import com.example.project.service.InputExtBusinessService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by dell on 2017/5/29.
 */
@Service
public class MyTask2 extends BaseTask{

    @Autowired
    InputExtBusinessService inputExtBusinessService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException{
        System.out.println("MyTask2.execute() "+new Date());
        inputExtBusinessService.quartzBonusNum();
    }


    @Override
    public String getCronExpression() {
        //每天上午10点到凌晨2点，每隔5分钟执行
        return "0 0/5 0-1 * * ?";
    }

}
